#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pii pair<int,int>
#define pb push_back
#define vec vector<int>
#define y1 y_____hahahaha_____1

using namespace std;

typedef long long ll;
typedef double db;
typedef unsigned long long ull;
typedef long double ldb;

int read(){int x = 0,sgn = 1;char ch = getchar();for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;for(;isdigit(ch);ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ 48); return x * sgn;}

const int N = 2e5+10;

int a[N],n,ans,f[N];

int main(){
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	n = in; for(int i = 1;i <= n;i++) a[i] = in;
	for(int i = 1;i < n;i++) f[i] = a[i + 1] - a[1];
	for(int i = 3;i < n;i++){
		f[i] = min(f[i],max(f[i - 2],a[i + 1] - a[i - 2]));
		if(i > 3) f[i] = min(f[i],max(f[i - 3],a[i + 1] - a[i - 3]));
	}
	ans = 2e9;
	for(int i = 1;i < n;i++) ans = min(ans,max(f[i],a[n] - a[i]));
	printf("%d\n",ans / 2);
	return 0;
}
